package com.ruoyi.common.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

@Component
public class TokenUtils {

    @Autowired
    private StringRedisTemplate redisTemplate;

    public String getUserDataFromToken(String token) {
        token="user:token:" + token;
        String userDataJson = redisTemplate.opsForValue().get(token);
        return userDataJson;
    }
}